package com.example.mapper;

import com.example.entity.Household;
import com.example.entity.Staffs;
import com.example.result.CommonResult;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @project: smart-property
 * @description: 登录 mapper 层
 * @author: cjq
 * @create: 2022-11-14 08:51
 **/
@Mapper
public interface LoginMapper {
    /**
     * 后台 账户密码 登录
     * @param staffs
     * @return
     */
    Staffs login(Staffs staffs);

    /**
     * 后台 新用户注册
     * @param staffs
     * @return
     */
    int register(Staffs staffs);

    /**
     * 查询账户是否有重复
     * @param staffNumber
     * @return
     */
    Staffs listStaffNumber(@Param("staffNumber") String staffNumber);

    /**
     * app端 账号密码登录
     * @param household
     * @return
     */
    Household appLogin(Household household);

    /**
     * 查询app端账户是否存在
     * @param accountNumber
     * @return
     */
    Household listAccountNumber(@Param("accountNumber") String accountNumber);

    /**
     * app端邮箱是否重复
     * @param email
     * @return
     */
    Household listEmail(@Param("email") String email);

    /**
     * app端手机号是否重复
     * @param phone
     * @return
     */
    Household listPhone(@Param("phone") String phone);

    /**
     * 修改密码
     * @param household
     * @return
     */
    int updatePassword(Household household);
}
